home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d897.lha / EPP / PModules / skipWhite.e < prev    next >
Text File  |  1993-06-26  |  814b  |  24 lines

  1. OPT TURBO
  2.  
  3. PROC skipWhite (theString,  /* PTR TO STRING */
  4.                 startPos)   /* Char index into theString, passed by value */
  5.   DEF length
  6.  
  7.   /* Skips SPACE, TAB, LF, CR.  Returns endPos so that                    */
  8.   /* MidStr (someString, theString, startPos, (endPos - startPos)) can be */
  9.   /* used in the calling program.                                         */
  10.   /* Return of -1 indicates access beyond end of string.                  */
  11.  
  12.   length := StrLen (theString)
  13.   IF startPos >= length THEN RETURN startPos
  14.  
  15.   WHILE (startPos < length) AND
  16.         ((theString [startPos] = " ") OR
  17.          (theString [startPos] = 9) OR   /* TAB */
  18.          (theString [startPos] = 10) OR  /* LF */
  19.          (theString [startPos] = 13))    /* CR */ DO INC startPos
  20.  
  21. ENDPROC  startPos
  22.   /* skipWhite */
  23.  
  24.